package com.example.pmxs;

import android.annotation.SuppressLint;
import android.content.ComponentName;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    @SuppressLint("ResourceType")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);


        TextView textView = findViewById(R.id.textView);//从布局文件中获取名叫textView的文本视图
        textView.setBackgroundColor(0X00FF00);//给文本视图设置背景为绿色的

        TextView textView1 = findViewById(R.id.textView2);//从布局文件中获取名叫textView的文本视图
        textView1.setBackgroundColor(0XFF00FF00);//给文本视图设置背景为绿色的

    }

//跳转到2.1.2像素
    public void dip2px(View view) {
        startActivity(new Intent().setClass(MainActivity.this, MainActivity2.class));


    }
//跳到2.1.3屏幕分辨率
    public void dipWidth(View view) {
        startActivity(new Intent().setClass(MainActivity.this, MainActivity3.class));
    }

    public void dipDensity(View view) {
        startActivity(new Intent().setClass(MainActivity.this, MainActivity4.class));
    }
}